﻿<script src="http://libs.baidu.com/jquery/1.9.1/jquery.js"></script>
<script src="@Url.Content("~/Scripts/modernizr-1.7.min.js")" type="text/javascript"></script>
<script src="http://libs.baidu.com/jqueryui/1.10.2/jquery-ui.min.js"></script>

<script src="@Url.Content("~/Scripts/jquery.ui.datepicker-zh-CN.js")" type="text/javascript"></script>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.js")" type="text/javascript"></script>

<script src="@Url.Content("~/Scripts/jquery.treeview.js")" type="text/javascript"></script>

<script src="@Url.Content("~/Scripts/jquery.contextMenu.r2.js")" type="text/javascript"></script>

<script src="@Url.Content("~/Scripts/SiteJs.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/SiteJs.fileInputCheck.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/select2.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/select2_locale_zh-CN.js")" type="text/javascript"></script>

<script type="text/javascript">
    $(function () {
        $.datepicker.setDefaults($.datepicker.regional["zh-CN"]);
        $.datepicker.setDefaults({ changeMonth: true, changeYear: true });
        $('input:submit').button();
        $('button').button();
        jQuery.extend({
            dialogReady: function (func, dialogid) {
                var dlg = "#dialogbox";
                if (dialogid) dlg = dialogid;
                $(dlg).one("dialogReady", func);
            }
        });
    });
    customDialogWidth = -1;
    function showDialog(dialogtitle, small) {
        //var dw = customDialogWidth < 0 ? (small ? 345 : 690) : customDialogWidth;
        //customDialogWidth = -1; ;
        //$('#dialogbox').dialog({ autoOpen: true, closeOnEscape: true, modal: true, title: dialogtitle, width:dw, show: "slide", hide: "slide" });
        //$('input:submit').button();
        //$.validator.unobtrusive.parse('#dialogbox');
        showDialogEx("#dialogbox");
    }
    function showDialogEx(dialogid, dialogtitle, small) {
        var dw = customDialogWidth < 0 ? (small ? 345 : 690) : customDialogWidth;
        customDialogWidth = -1;;

        $(dialogid).dialog({ autoOpen: true, closeOnEscape: true, modal: true, title: dialogtitle, width: dw, show: "slide", hide: "slide" });
        $('input:submit').button();
        $('button').button();
        $.validator.unobtrusive.parse(dialogid);
        $(dialogid).trigger("dialogReady");
    }


</script>
<script type="text/javascript">
    function OnSiteError(ctx, b, c) {
        if (c == "Site Action Exception") {
            var err = $.parseJSON(ctx.responseText);
            if (err) {
                alert("操作中遇到错误:\r\n" + err.error);
            } else {
                alert("操作中遇到错误，请检查操作是否正确，或请联系管理员处理。");
            }
        } else {
            alert("操作中遇到错误，请检查操作是否正确，或请联系管理员处理。");
        }
    }
    function OnConfirmDel() {
        return confirm("请问确认要删除此内容吗？删除后将无法恢复。");
    }
</script>
